#include <iostream>
#include <signal.h>
#include <unistd.h>
void handler(int signo)
{
    std::cout << "cat a signo: " << signo << std::endl;
}

int main()
{
    struct sigaction act, oact;
    sigemptyset(&act.sa_mask);
    sigemptyset(&oact.sa_mask);

    sigaddset(&act.sa_mask, 1);
    sigaddset(&act.sa_mask, 3);
    sigaddset(&act.sa_mask, 4);
    act.sa_handler = handler;

    sigaction(2, &act, &oact);
    
    while (true)
    {
        std::cout << "I am a process: " << getpid() << std::endl;
        sleep(1);
    }
    return 0;
}